home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / misc / gs261src.zip / errors.h < prev    next >
C/C++ Source or Header  |  1993-05-13  |  5KB  |  129 lines

  1. /* Copyright (C) 1989, 1992 Aladdin Enterprises.  All rights reserved.
  2.  
  3. This file is part of Ghostscript.
  4.  
  5. Ghostscript is distributed in the hope that it will be useful, but
  6. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  7. to anyone for the consequences of using it or for whether it serves any
  8. particular purpose or works at all, unless he says so in writing.  Refer
  9. to the Ghostscript General Public License for full details.
  10.  
  11. Everyone is granted permission to copy, modify and redistribute
  12. Ghostscript, but only under the conditions described in the Ghostscript
  13. General Public License.  A copy of this license is supposed to have been
  14. given to you along with Ghostscript so you can know your rights and
  15. responsibilities.  It should be in a file named COPYING.  Among other
  16. things, the copyright notice and this notice must be preserved on all
  17. copies.  */
  18.  
  19. /* errors.h */
  20. /* Define error codes for Ghostscript */
  21.  
  22. /* A procedure that may return an error always returns */
  23. /* a non-negative value (zero, unless otherwise noted) for success, */
  24. /* or negative for failure. */
  25. /* We use ints rather than an enum to avoid a lot of casting. */
  26.  
  27. /* The following peculiar structure allows us to include this file */
  28. /* wherever error code definitions are needed, and use the same file */
  29. /* to generate the table of error names by setting INCLUDE_ERROR_NAMES. */
  30.  
  31. #        ifdef INCLUDE_ERROR_NAMES
  32.  
  33. /* Define the error name table */
  34. const char _ds *gs_error_names[] = {
  35. #define _e_(code,name) name,
  36.  
  37. #        else            /* !INCLUDE_ERROR_NAMES */
  38.  
  39. extern const char _ds *gs_error_names[];
  40. #  define _e_(code,name)
  41.  
  42. #endif                    /* (!)INCLUDE_ERROR_NAMES */
  43.  
  44.         /* ------ PostScript Level 1 errors ------ */
  45.  
  46. #define e_unknownerror (-1)        /* unknown error */
  47.   _e_(e_unknown, "unknownerror")
  48. #define e_dictfull (-2)
  49.   _e_(e_dictfull, "dictfull")
  50. #define e_dictstackoverflow (-3)
  51.   _e_(e_dictstackoverflow, "dictstackoverflow")
  52. #define e_dictstackunderflow (-4)
  53.   _e_(e_dictstackunderflow, "dictstackunderflow")
  54. #define e_execstackoverflow (-5)
  55.   _e_(e_execstackoverflow, "execstackoverflow")
  56. #define e_interrupt (-6)
  57. /* We also need to define gs_error_interrupt, for gpcheck.h. */
  58. #undef gs_error_interrupt
  59. #define gs_error_interrupt e_interrupt
  60.   _e_(e_interrupt, "interrupt")
  61. #define e_invalidaccess (-7)
  62.   _e_(e_invalidaccess, "invalidaccess")
  63. #define e_invalidexit (-8)
  64.   _e_(e_invalidexit, "invalidexit")
  65. #define e_invalidfileaccess (-9)
  66.   _e_(e_invalidfileaccess, "invalidfileaccess")
  67. #define e_invalidfont (-10)
  68.   _e_(e_invalidfont, "invalidfont")
  69. #define e_invalidrestore (-11)
  70.   _e_(e_invalidrestore, "invalidrestore")
  71. #define e_ioerror (-12)
  72.   _e_(e_ioerror, "ioerror")
  73. #define e_limitcheck (-13)
  74.   _e_(e_limitcheck, "limitcheck")
  75. #define e_nocurrentpoint (-14)
  76.   _e_(e_nocurrentpoint, "nocurrentpoint")
  77. #define e_rangecheck (-15)
  78.   _e_(e_rangecheck, "rangecheck")
  79. #define e_stackoverflow (-16)
  80.   _e_(e_stackoverflow, "stackoverflow")
  81. #define e_stackunderflow (-17)
  82.   _e_(e_stackunderflow, "stackunderflow")
  83. #define e_syntaxerror (-18)
  84.   _e_(e_syntaxerror, "syntaxerror")
  85. #define e_timeout (-19)
  86.   _e_(e_timeout, "timeout")
  87. #define e_typecheck (-20)
  88.   _e_(e_typecheck, "typecheck")
  89. #define e_undefined (-21)
  90.   _e_(e_undefined, "undefined")
  91. #define e_undefinedfilename (-22)
  92.   _e_(e_undefinedfilename, "undefinedfilename")
  93. #define e_undefinedresult (-23)
  94.   _e_(e_undefinedresult, "undefinedresult")
  95. #define e_unmatchedmark (-24)
  96.   _e_(e_unmatchedmark, "unmatchedmark")
  97. #define e_VMerror (-25)
  98.   _e_(e_VMerror, "VMerror")
  99.  
  100.         /* ------ Additional Level 2 and DPS errors ------ */
  101.  
  102. #define e_invalidcontext (-26)
  103.   _e_(e_invalidcontext, "invalidcontext")
  104. #define e_undefinedresource (-27)    /* not used yet */
  105.   _e_(e_undefinedresource, "undefinedresource")
  106.  
  107. #        ifdef INCLUDE_ERROR_NAMES
  108.  
  109. /* End of error name table */
  110.   0
  111. };
  112.  
  113. #        endif            /* INCLUDE_ERROR_NAMES */
  114.  
  115.         /* ------ Pseudo-errors used internally ------ */
  116.  
  117. /* Internal code for a fatal error. */
  118. /* gs_interpret also returns this for any non-zero quit. */
  119. #define e_Fatal (-100)
  120.  
  121. /* Internal code for the `quit' operator. */
  122. /* The real quit code is an integer on the operand stack. */
  123. /* gs_interpret returns this only for a quit with a zero exit code. */
  124. #define e_Quit (-101)
  125.  
  126. /* Internal code for a normal exit from the interpreter. */
  127. /* Do not use outside of interp.c. */
  128. #define e_InterpreterExit (-102)
  129.